<template name="drawer_left">
  <div class="drawer" id="leftDrawer">
    <div class="drawer-content">
      <ul class="listview">
        {{> drawer_left_list_item
          href = "/"
          title = "Class"
        }}
        {{> drawer_left_list_item
          href = "#"
          icon = "view_list"
          title = "发现频道"
        }}
        {{> drawer_left_list_item
          href = "#"
          icon = "search"
          title = "搜索"
        }}
      </ul>
      {{#if currentUser}}
        <hr class="my-0">
        <ul class="listview">
          {{> drawer_left_list_item
            href = "/i"
            title = "个人中心"
          }}
          {{> drawer_left_list_item
            href = "/channels"
            icon = "bubble_chart"
            title = "我的频道"
          }}
          {{> drawer_left_list_item
            href = "/friends"
            icon = "people"
            title = "好友"
          }}
          {{> drawer_left_list_item
            href = "/notifications"
            icon = "notifications"
            title = "通知"
          }}
          {{> drawer_left_list_item
            href = "/settings"
            icon = "settings"
            title = "设置"
          }}
        </ul>
        <hr class="my-0">
        <div class="px-3 py-3">
          <a href="/new-channel" class="btn btn-outline-primary btn-block">创建新频道</a>
        </div>
      {{/if}}
    </div>
  </div>
</template>

<template name="drawer_left_list_item">
  <li class="list-item">
    <a href="{{href}}" class="item-link">
      {{#if icon}}
        <i class="material-icons">{{icon}}</i>
      {{/if}}
      <span class="{{#unless icon}}px-0{{/unless}}">{{title}}</span>
    </a>
  </li>
</template>